% Basic objects in pgf/tikz style file.

\newcommand{\DefaultArgs}[6]
{
	xshift=#1cm,
	yshift=#2cm,
	xscale=#3,
	yscale=#4,
	xslant=#5,
	yslant=#6
}

\newcommand{\HardDrive}[6]
{
	\draw[line width=1pt, shade=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0) ellipse (0.4 and 0.2);

	\draw[line width=1pt,
		shade=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0.15) ellipse (0.4 and 0.2);

	\draw[line width=1pt,
		shade=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0.3) ellipse (0.4 and 0.2);
}

\newcommand{\Xterminal}[6]
{
	% Keyboard.
	\draw[line width=2pt, fill=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0) -- (1.2,0) -- (1.0,0.2) -- (0.2,0.2) -- cycle;

	% Monitor.
	\draw[line width=2pt, rounded corners, fill=black, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0.1,0.2) rectangle (1.1,1.0);
		
	% Text >_ in the terminal.
	\draw[line width=1pt, green, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0.4,0.75) node {\texttt{>\_}};
}
\newcommand{\Workstation}[6]
{
	% CPU box.
	\draw[line width=2pt, fill=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(1.0,0.1) rectangle (1.5,0.9);
	
	% Diskette doors.
	\draw[line width=1pt, white, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(1.1,0.3) -- (1.4,0.3)
		(1.1,0.5) -- (1.4,0.5)
		(1.1,0.6) -- (1.4,0.6);

	\Xterminal{#1}{#2}{#3}{#4}{#5}{#6}

}
\newcommand{\Server}[6]
{
	% CPU box.
	\draw[line width=2pt, fill=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0) rectangle (0.6,1.0);
	
	% Diskette doors.
	\draw[line width=1pt, white, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0.1,0.2) -- (0.5,0.2)
		(0.1,0.4) -- (0.5,0.4)
		(0.1,0.5) -- (0.5,0.5);
}

\newcommand{\FileServer}[6]
{
	% CPU box.
	\draw[line width=2pt,
		fill=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0.3,0) rectangle (0.9,1.0);
	
	% Diskette doors.
	\draw[line width=1pt,
			white, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0.4,0.2) -- (0.8,0.2)
		(0.4,0.4) -- (0.8,0.4)
		(0.4,0.5) -- (0.8,0.5);

	\HardDrive{#1}{#2}{#3}{#4}{#5}{#6}
}

\newcommand{\ProcessorPool}[6]
{
	\draw[line width=2pt, fill=white, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0) rectangle (2.3,3.4);

	\foreach \x in {0.2,0.6,...,1.9}
		\foreach \y in {0.2,1.0,1.8,2.6}
			\draw[line width=1pt, fill=gray, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
				(\x cm,\y cm) rectangle (\x cm+0.3cm,\y cm + 0.6cm);

	\foreach \y in {0.9,1.7,2.5}
		\draw[line width=1pt, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
			(0.2, \y) -- (2.1, \y);	

}

\newcommand{\TextCloud}[7]
{
	\draw[line width=1.5pt, blue, fill=blue!20, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6]
		(0,0) ellipse (2 and 1);

	\coordinate [label=above:#7, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4, xslant=#5, yslant=#6] (PatchLabel) at (0,-0.2);

}

\newcommand{\CapabilityDS}[8]
{
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (0, 0) rectangle (4.0, 1);
	\coordinate [label=below:\textsf{#5}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (ServerPort) at (2.0,0.75);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (4.0, 0) rectangle (7, 1);
	\coordinate [label=below:\textsf{#6}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (ObjectID) at (5.5,0.75);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (7, 0) rectangle (8.8, 1);
	\coordinate [label=below:\textsf{#7}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (Permissions) at (7.85,0.75);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (8.8, 0) rectangle (12.8, 1);
	\coordinate [label=below:\textsf{#8}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (CheckField) at (10.8,0.75);
}

\newcommand{\CapabilityDSScaled}[8]
{
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (0, 0) rectangle (4.0, 1);
	\coordinate [label=below:\textsf{#5}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (ServerPort) at (1.0,0.375);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (4.0, 0) rectangle (7, 1);
	\coordinate [label=below:\textsf{#6}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (ObjectID) at (2.75,0.375);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (7, 0) rectangle (8.8, 1);
	\coordinate [label=above:\textsf{#7}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (Permissions) at (3.925,-0.025);
	
	\draw[very thick, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (8.8, 0) rectangle (12.8, 1);
	\coordinate [label=above:\textsf{#8}, xshift=#1cm, yshift=#2cm, xscale=#3, yscale=#4] (CheckField) at (5.4,-0.09);
}